package com.qst.service;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.github.pagehelper.PageInterceptor;
import com.qst.dao.IEmployeeDao;
import com.qst.dao.MeetingDao;
import com.qst.pojo.Employee;
import com.qst.pojo.Meeting;
import com.qst.pojo.MeetingRoom;
import com.qst.pojo.SearchMeeting;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

@Service
public class SearchService {
    @Autowired
    public MeetingDao meetingDao;
    @Autowired
    public IEmployeeDao employeeDao;

    private static final Integer PAGESIZE = 10;

    /**
     * @return
     */
    public List<SearchMeeting> findMeeting(SearchMeeting searchMeeting, Integer page) {

        //第page页显示PAGESIZE条信息
        PageHelper.startPage(page, PAGESIZE);
        List<SearchMeeting> meetingList = meetingDao.findAllMeeting(searchMeeting);

        return meetingList;
    }

    public  List<Employee> findEmployee(Employee employee){
        return  employeeDao.findEmployeeBynameWithId(employee);
    }

    public List<Meeting> findMeetingByRid(Integer rId) {

        return meetingDao.findMeetingById(rId);
    }
}
